<template>
    <div>
        <!-- 论文信息 -->
        <div class="bg-white ">
            <BaseHead>论文信息</BaseHead>
            <div class="p-[10px]">
                <el-descriptions title="" :column="2" border label-width="140">
                    <el-descriptions-item label-class-name="gdlable" :span="2" label="名称">{{
                    xmInfo.name
                }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="发表/出版时间">{{
                        dateFormatter3(xmInfo.publishDate)
                    }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="所有作者"><span type="primary"
                            v-for="(item, index) in xmInfo.authorList" :key="item.paperId">{{
                    item.authorName
                }}<span v-if="index + 1 != xmInfo.authorList.length">,</span></span></el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="发表/刊物论文集">{{
                    xmInfo.magazineName
                }}</el-descriptions-item>
                </el-descriptions>
            </div>
        </div>
        <!-- 收录信息 -->
        <div class="bg-white mt-[10px]">
            <BaseHead>收录信息</BaseHead>
            <div class="p-[10px]">
                <el-descriptions title="" :column="2" border label-width="140">
                    <el-descriptions-item label-class-name="gdlable" label="论文名称">{{
                    xmInfo.name
                }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="收录日期">{{
                        dateFormatter3(ruleForm.embodyDate)
                    }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="收录类型">
                        <Feedback :id="ruleForm.embodyTypeId" :list="slList">
                        </Feedback>
                    </el-descriptions-item>
                    <el-descriptions-item
                        v-if="ruleForm.embodyTypeIdList && ruleForm.embodyTypeIdList.length && ruleForm.embodyTypeIdList.includes('300601')"
                        label-class-name="gdlable" label="大类分区">{{
                    ruleForm.sciPartition == 1 ? '一区' : ruleForm.sciPartition == 2 ? '二区' :
                        ruleForm.sciPartition == 3 ? '三区' : '四区'
                }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="影响因子">{{
                        ruleForm.factor
                    }}</el-descriptions-item>
                    <el-descriptions-item label-class-name="gdlable" label="收录证明附件">
                        <div v-for="item in ruleForm.fileList" :key="item.id">{{ item.fileName
                            }}<el-link type="primary" style="margin-left: 8px;"
                                @click="downloadMet(item.id)">下载</el-link>
                        </div>
                    </el-descriptions-item>
                </el-descriptions>
            </div>
        </div>
    </div>
</template>
<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import { getpaperInfo, getlevelList } from "@/api/achievement/kycg"
const props = defineProps({
    id: String,
})
const ruleForm = reactive({
});

const getRuleForm = (i) => {
    for (const key in i) {
        ruleForm[key] = i[key];
    }
    viewXm()
}
const xmInfo = ref({})
const viewXm = () => {
    getpaperInfo(ruleForm.paperId).then((res) => {
        if (res.code == 200) {
            xmInfo.value = res.data
        }
    })
    // getslTable()
};
const { proxy } = getCurrentInstance();
const downloadMet = (i) => {
    proxy.$download.common(i)
}

const slList = ref([])
const getslList = async () => {
    let parms = {
        pageNum: 1,
        pageSize: 100
    }
    let res = await getlevelList(parms)
    if (res.code == 200) {
        slList.value = res.rows.filter(item => {
            return item.isEmbody == '1'
        })
    }
}
getslList()
defineExpose({
    getRuleForm
})
</script>
<style lang="scss">
.gdlable {
    width: 140px;
}
</style>
<style scoped lang="scss">
@import url("@/views/achievement/index.scss");

:deep(.el-select--default) {


    .el-select__wrapper.is-disabled {
        background-color: #fff;
        box-shadow: 0 0 0 0px var(--el-select-disabled-border) inset;
        color: #606266;
        cursor: not-allowed;

        .el-select__selected-item {
            color: #606266;
        }
    }

    .el-select__suffix {
        display: none;
    }
}
</style>
